readMap

open fun <K, V> readMap(@NonNull in: @NonNull Parcel, @NonNull outVal: @NonNull Map<in K, in V>, @Nullable loader: @Nullable ClassLoader, @NonNull clazzKey: @NonNull Class<K>, @NonNull clazzValue: @NonNull Class<V>)(source)

Same as readMap but accepts clazzKey and clazzValue parameter as the types required for each key and value pair. Compatibility behavior:

  • SDK 34 and later, this method matches platform behavior.
  • SDK 33 and below, this method will not check the map entries' types.

Throws

If the item to be deserialized is not an instance of that class or any of its children class.